#include <iostream>
#include <vector>
#include <algorithm>

int findKthLargest(std::vector<int>& nums, int k) {
    std::sort(nums.begin(), nums.end(), [](int a, int b){
        return a > b;
    });

    return nums[k - 1];
}

int main() {
    std::vector<int> nums = {3, 2, 1, 5, 6, 4};
    int k = 2;
    int result = findKthLargest(nums, k);

    std::cout << "The " << k << "th largest element in the array is: " << result << std::endl;

    return 0;
}